package xw4g08.sameAs;

import org.apache.commons.math.MathException;
import org.apache.commons.math.distribution.ZipfDistributionImpl;

public class satest {
	
	
	private final static double exp = 2.528;
	//static int a = 3062000;
	static int n = 4174;
	static long round = 3449;
	public static void main(String[] args) {
		ZipfDistributionImpl zipf = new ZipfDistributionImpl(n, exp);
		long total = 0;
		while(round >= 0) {
			int x=0;
			try {
				x = zipf.sample();
				total+=x;
				if(round%20 != 0)
					System.out.print(x+"  ");
				else System.out.println(x);
			} catch (MathException e) {
				e.printStackTrace();
			}
			round--;
		}
		System.out.println("The sum is: "+total);

	}

}
